﻿

/// <summary>
/// Heavily modified code from
/// http://leedumond.com/blog/asp-net-profiles-in-web-application-projects/
/// </summary>
/// 


using System;
using System.Web;
using System.Web.Profile;

// Modified from http://leedumond.com/blog/asp-net-profiles-in-web-application-projects/

public class CustomProfile : ProfileBase
{
    public Personal Personal
    {
        get { return (Personal)GetPropertyValue("Personal"); }
    }

    /// <summary>
    /// Get the profile of the currently logged-on user.
    /// </summary>      
    public static CustomProfile GetProfile()
    {
        return (CustomProfile)HttpContext.Current.Profile;
    }

    /// <summary>
    /// Gets the profile of a specific user.
    /// </summary>
    /// <param name="userName">The user name of the user whose profile you want to retrieve.</param>
    public static CustomProfile GetProfile(string userName)
    {
        return (CustomProfile)Create(userName);
    }
}

[Serializable]
public class Personal
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public int Age { get; set; }
    public string Address { get; set; }

}